<template>
	<view>
		<view>
			<navigator url="../datashow/datashow?id=80&name=tom">
				<button>
					跳转到datashow页面
				</button>
			</navigator>
		</view>
		<view>
			<navigator url="../index/index?id=80" open-type="switchTab">
				<button>
					跳转到index页面
				</button>
			</navigator>
		</view>
		<view>
			<button type="primary" @click="gotopage">跳转到datashow页面</button>
		</view>
		<view>
			<button type="primary" @click="gotoredirect">跳转到datashow页面</button>
		</view>
		<view>
			<button type="warn" @click="gototab">跳转到index页面</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		onUnload() {
			console.log("当前页面被卸载了")
		},
		data() {
			return {
				
			}
		},
		methods: {
			gotopage(){
				uni.navigateTo({
					url:"../datashow/datashow",
					success(){
						console.log("跳转成功")
					}
				})
			},
			gotoredirect(){
				uni.redirectTo({
					url:"../datashow/datashow",
					success(){
						console.log("跳转成功")
					}
				})
			},
			gototab(){
				uni.switchTab({
					url:"../index/index?id=80&name=tom",
					success() {
						console.log("跳转成功")
					}
				})
			}
			
		}
	}
</script>

<style>

</style>
